from xinference.client import RESTfulClient
# http://192.168.8.191:9997/qwen2-instruct
from hetong.config import *


def send_message(question, system_prompt=None, chat_history=None):
    '''
    请求大模型返回的信息
    '''
    client = RESTfulClient(url)
    model = client.get_model(model_id)
    result = model.chat(
        prompt=question,
        system_prompt=system_prompt,
        chat_history=chat_history
    )
    return result


if __name__ == '__main__':
    q = '''
   '''
    result = send_message(q, '你是一个工程师')
    print(result)
